<?php

$pid = pcntl_fork();

// echo PHP_OS . PHP_EOL;
// echo posix_getpid() . PHP_EOL;
// echo getmypid() . PHP_EOL;

if ($pid == -1) {
    exit('创建失败');
}

if ($pid) {
    exit($pid . ' parent process' . PHP_EOL);
}

exit($pid . ' child process' . PHP_EOL);